/**
 * Created by fangshufeng on 2018/1/9.
 */
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var cors = require('cors');

// var index = require('./routes/index');
// var users = require('./routes/users');

var app = express();
app.use(cors());
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());

app.use(express.static('build'));
app.use('/mockTool/',express.static('build'));
app.get('/mockTool/*', function (req, res) {
    res.sendFile(path.join(__dirname, 'build', 'index.html'))
});
// app.use('/', index);
// app.use('/users', users);

module.exports = app;